From 8ec7facba387ad9daddda55949332aa8afebf2f1 Mon Sep 17 00:00:00 2001 From: Gianni Tedesco Date: Fri, 10 Sep 2010 18:47:53 +0100 Subject: [PATCH] xl: fix double free of domain names Assigning malloc'd variables from one structure to another when both of them are free'd via destructors is a bad idea. Let's use a strdup. Signed-off-by: Gianni Tedesco --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index c8df350be9..d92e288ede 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -296,7 +296,7 @@ static void init_dm_info(libxl_device_model_info *dm_info, libxl_uuid_generate(&dm_info->uuid); - dm_info->dom_name = c_info->name; + dm_info->dom_name = strdup(c_info->name); dm_info->device_model = strdup("qemu-dm"); dm_info->videoram = b_info->video_memkb / 1024; dm_info->apic = b_info->u.hvm.apic; -- 2.30.2